#import <UIKit/UIView.h>

@class NSMutableArray;
@class NSNotification;
@class UIPreferencesTableCell;
@class UIPreferencesTextTableCell;
@class UIPreferencesTable;
@class UIPreferencesControlTableCell;
@class UISwitchControl;
@class UINavigationBar;
@class UITransitionView;
@class UITable;
@class UIApplication;

@interface PreferencesView: UIView
{
	UINavigationBar *navBar;
	
	// transition view
	UITransitionView *view;
	
	// tables
	UIPreferencesTable *table;
	UITable *hostTable;
	
	// host
	UIPreferencesTableCell *host;
	
	// panel
	UISwitchControl *clickSound;
	UISwitchControl *mousePanel;
	UISwitchControl *inputPanel;
	UIPreferencesControlTableCell *clickSoundCell, *mousePanelCell, *inputPanelCell;
	
	// mouse
	UIPreferencesTextTableCell *mouseMargin;
	UISwitchControl *mouseMoveAbsolute;
	UISwitchControl *mouseRotateLandscape;
	UIPreferencesControlTableCell *mouseMoveAbsoluteCell, *mouseRotateLandscapeCell;
	
	// status bar
	UIPreferencesTextTableCell *leftBind, *centerBind, *rightBind;
	
	// parent
	UIApplication *parent;
	
	// showing
	BOOL showing;
	
	// host list
	NSMutableArray *hosts;
}

- (void)dealloc;
- (void)save;

- (BOOL)isShowing;
- (BOOL)show;

- (NSString *)host;
- (BOOL)isClickSoundEnabled;
- (BOOL)isMousePanelEnabled;
- (BOOL)isInputPanelEnabled;

- (BOOL)mouseMoveAbsolute;
- (BOOL)mouseRotateLandscape;
- (int)mouseMargin;

- (NSString *)leftBind;
- (NSString *)centerBind;
- (NSString *)rightBind;

// navigation bar delegate
- (void)navigationBar: (UINavigationBar*)navigationBar buttonClicked: (int)button;

- (id)initWithFrame: (CGRect)frame parent: (UIApplication *)app;
- (void)reloadData;

// - (BOOL)table: (UITable *)aTable canSelectRow: (int)row;

// delegates
- (void)tableRowSelected: (NSNotification *)notification;

// data sources
- (int)numberOfGroupsInPreferencesTable: (UIPreferencesTable *)table;
- (int)preferencesTable: (UIPreferencesTable *)table numberOfRowsInGroup: (int)group;
// - (id)preferencesTable: (UIPreferencesTable *)table titleForGroup: (int)group;
- (UIPreferencesTableCell *)preferencesTable: (UIPreferencesTable *)table cellForRow: (int)row inGroup: (int)group;

@end
